//
// Created by 11793 on 2025/11/7.
//
#include "sqlite3.h"
#include <stdio.h>
#include "db_operation.h"
sqlite3 *db = NULL;
int  open_db(){
    int rc = sqlite3_open("BookSales", &db);
    if (rc != SQLITE_OK) {
        fprintf(stderr, "无法打开数据库: %s\n", sqlite3_errmsg(db));
        return -1;
    }
    printf("数据库已打开!\n");
    return 1;
}
int close_db(){
    int rc = sqlite3_close(db);
    if (rc == SQLITE_OK){
        printf("数据库已关闭!\n");
    }
    return 0;
}